package com.ruicar.afs.cloud.aggregate.aggregateport;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.common.core.feign.AfsFeignFormSupport;
import com.ruicar.afs.cloud.common.core.feign.annotations.AfsFeignClear;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author jiaqi.guo
 * @version 1.0
 * @description: 对接长城集合服务
 * @created 2020/7/15 16:07
 */
@FeignClient(name = "aggregate", url = "${com.greatwall.systems.aggregate-system.url}", configuration = AfsFeignFormSupport.class)
public interface AggregateApiFeign {
    /**
     * 二手车历史存量vin查询
     *
     * @param vin
     * @return
     */
    @GetMapping(value = "/M31003/get/vincheck/allbutdraft")
    @AfsFeignClear(true)
    JSONObject getUsedCar(@RequestParam("vin") String vin);

    /**
     * 历史贷款金额主借人、共借人
     *
     * @param
     * @return
     */
    @GetMapping(value = "/M31003/get/loanhistory")
    @AfsFeignClear(true)
    JSONObject getLoanhistory(@RequestParam("borrowerCertno") String borrowerCertno, @RequestParam("coborrowerCertno") String coborrowerCertno);

    /**
     * 放款阶段vin查重
     *
     * @param
     * @return
     */
    @GetMapping(value = "/M31003/get/vincheck/loanperiod")
    @AfsFeignClear(true)
    JSONObject loanperiod(@RequestParam("vin") String vin);

    /**
     * 身份证验重
     *
     * @param
     * @return
     */
    @GetMapping(value = "/M31003/get/checkcertnorepeat")
    @AfsFeignClear(true)
    JSONObject checkcertnorepeat(@RequestParam("borrowerCertno") String borrowerCertno, @RequestParam("coborrowerCertno") String coborrowerCertno,@RequestParam("guarantorCertno") String guarantorCertno);

    /**
     * 二手车进件申请VIN验重
     *
     * @param
     * @return
     */
    @GetMapping(value = "/M31003/get/vincheck/usedcarcheck")
    @AfsFeignClear(true)
    JSONObject usedcarcheck(@RequestParam("vin") String vin);

    /**
     * 网约车挂靠公司信审
     *
     * @param
     * @return
     */
    @GetMapping(value = "/M31003/get/affiliatedcheck")
    @AfsFeignClear(true)
    JSONObject affiliatedcheck(@RequestParam("creditCode") String creditCode,@RequestParam("limitNumber") int limitNumber);

}
